﻿<UserControl x:Class="Delegen.VSThemeColorsViewer.ThemeColorsViewerControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.12.0"
             Background="{DynamicResource VsBrush.Window}"
             Foreground="{DynamicResource VsBrush.WindowText}"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="500"
             Name="MyToolWindow">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <DockPanel Grid.Row="0" Background="White">
            <Label VerticalContentAlignment="Center" >Red:</Label>
            <TextBox Name="TextBoxRed" VerticalContentAlignment="Center" Margin="5" Height="22" Width="50" VerticalAlignment="Stretch" DockPanel.Dock="Left"></TextBox>
            <Label VerticalContentAlignment="Center" >Green:</Label>
            <TextBox Name="TextBoxGreen" VerticalContentAlignment="Center" Margin="5" Height="22" Width="50" VerticalAlignment="Stretch" DockPanel.Dock="Left"></TextBox>
            <Label VerticalContentAlignment="Center" >Blue:</Label>
            <TextBox Name="TextBoxBlue" VerticalContentAlignment="Center" Margin="5" Height="22" Width="50" VerticalAlignment="Stretch" DockPanel.Dock="Left"></TextBox>
            <Button Width="50" Height="24" HorizontalAlignment="Left" Margin="5" Name="ButtonFilter" Click="ButtonFilter_Click">Filter</Button>
            <Button Width="50" Height="24" HorizontalAlignment="Left" Margin="5" Name="ButtonRefresh" Click="ButtonRefresh_Click">Refresh</Button>
            <Label Name="LabelMouseColor" Margin="5" MouseDown="LabelMouseColor_MouseDown" MouseUp="LabelMouseColor_MouseUp" ToolTip="Click and drag to pick color">Color Picker</Label>
        </DockPanel>
        <ListView Name="ListViewColors" Grid.Row="1" SelectionMode="Single">
            <ListView.Resources>
                <ContextMenu x:Key="ContextMenuColor" StaysOpen="true">
                    <MenuItem x:Name="MenuItemCopy" Header="Copy" Click="MenuItemCopy_Click" ToolTip="Copy color key">
                    </MenuItem>
                </ContextMenu>
            </ListView.Resources>
            <ListView.View>
                <GridView>                  
                    <GridViewColumn Header="Color Key" Width="270" DisplayMemberBinding="{Binding ColorKey}"/>
                    <GridViewColumn Header="Color" Width="200">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Label Background="{Binding Color}" Width="270" Height="22" Foreground="{Binding FontColor}">
                                    <TextBlock Text="{Binding RGB}" />
                                </Label>    
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</UserControl>
